package bloomersseeds2340

class SeedsRegController {
    
    def index() {}
    
    def createSeed(){
        def seedInstance = new Seeds()
        seedInstance.properties = params
        
        
        //seed.save()
        
        print seedInstance.hardinessZone
        
        
        
        
        redirect (controller:'UserHome')
        
        //return [seedInstance: seedInstance]
    }
    
    def saveSeed(){
        def seed = new Seeds(params)
        
        print seed.hardinessZone
        
        if (seed.save(flush: true)) {
            flash.message="${message(code: 'default.created.message', args: [message(code: 'seeds.label', default: 'Seeds'), seed.id])}"
            redirect(controller: "UserHome")
            
            //this gives the id number for the seed id: seed.id
            //should prob use this to assign to current user
        }
        else {
            render(view:"index",model: [seed: seed])
        }
    }

  //  def scaffold = Seeds
}
